<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="/global/jsp-header.jsp"%>
<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html">
		<title>新增访问路径</title>
		<%@ include file="/global/html-header.jsp"%>
		<script>
	$(function() {
		$('.myform').idealforms();
		common.validator("actionuriform");
		//添加访问路径
		$("#actionuriform").submit(function(){
			var param=$(this).serialize();
			var canSubmit=common.checkBlankValue(param,new Array("actionUri.actionUri","actionUri.actionName","actionUri.note"));
			if(canSubmit){
				$.ajax({   
	        		type: "POST",  
	        		url: "${action }",  
	        		data: param, 
	        		success: function(msg){    
		        		window.parent.closeDialog();
		        		var alertMsg="";
	        			<c:if test="${addOperater}">
		        			if(msg=="success"){
	            				alertMsg="访问路径添加成功！";
	            				$(window.parent.document).find("#myform").submit();
	            			}else if(msg=="exists"){
	            				alertMsg="访问路径已存在！";
	            			}else{
	            				alertMsg="访问路径添加失败！";
	            			}
	        			</c:if>
	        			<c:if test="${updateOperater}">
		        			if(msg=="success"){
		        				$(window.parent.document).find("#myform").submit();
		        				alertMsg="访问路径更新成功！";
	            			}else if(msg=="existUri"){
	            				alertMsg="访问路径值已存在！";
	            			}else if(msg=="nochange"){
	            				alertMsg="访问路径属性没有改变！";
	            			}else{
	            				alertMsg="访问路径更新失败！";
	            			}
        				</c:if>
        				window.parent.editActionUriTip(alertMsg);
	        		} 
	        	});
			}
			return false;
		});
	});
</script>
	</head>
	<body>
		<form action="${action }" name="actionuriform" class="myform"
			id="actionuriform" method="post">
		<input type="hidden" name="actionUri.actionId" value="${actionUri.actionId }"/>
		<div>
			<label class="required">
				访问路径路径:
			</label>
			<input type="text" size="40" name="actionUri.actionUri" class="{required:true,messages:{required:'请输入访问路径编号'}}"  value="${actionUri.actionUri }"/>
		</div>
		<div>
			<label class="required">
				访问路径名称:
			</label>
			<input type="text" size="40" name="actionUri.actionName" class="{required:true,messages:{required:'请输入访问路径名称'}}" value="${actionUri.actionName }"/>
		</div>
		<div>
			<label class="required">
				访问路径注释:
			</label>
			<input type="text" size="40" name="actionUri.note"
				class="{required:true,messages:{required:'请输入访问路径职能'}}" value="${actionUri.note }" />
		</div>
		<div>
			<label>
				&nbsp;
			</label>
			<input type="submit" value="${btnKeyWord }" />
		</div>
	</form>
	</body>
</html>